package com.hsav.kcxb.fragment;

import android.app.Activity;
import android.media.Image;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.hsav.kcxb.R;
import com.hsav.kcxb.adapter.MsgAdapter;

/**
 * Created by zhao on 16-12-9.
 */

public class MessageFragment extends Fragment {

    private View mRootView;
    private ListView mMsgListView;
    private ImageView mAddImg;
    private TextView mTitleTX;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
    public void OnShowWindow(Activity activity, boolean show){
        if (show){
        }
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mRootView = inflater.inflate(R.layout.frag_msg_layout,container,false);
        initView();
        return mRootView;
    }

    private void initView() {
        mAddImg = (ImageView)mRootView.findViewById(R.id.iv_top_back);
        mTitleTX = (TextView)mRootView.findViewById(R.id.tv_top_title);
        mAddImg.setVisibility(View.VISIBLE);

        mAddImg.setImageResource(R.drawable.add);
        mTitleTX.setText("消息");

        mMsgListView = (ListView)mRootView.findViewById(R.id.listview_msg);
        MsgAdapter msgAdapter = new MsgAdapter(getActivity());
        mMsgListView.setAdapter(msgAdapter);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }



    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
